package com.flx.at.spring.code.test.testapplicationlistener;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Author: Fenglixiong
 * @Date: 2021/7/3 11:52
 * @Description:
 */
public class MainApp {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(ListenerConfig.class);

        ctx.publishEvent(new ApplicationEvent("【手动发布事件】I am a good person !") {
            @Override
            public Object getSource() {
                return super.getSource();
            }
        });

        ctx.close();

    }

}
